﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Microsoft.Practices.Repository;
using DotNetCore.BannerManagement.Domain;

namespace DotNetCore.BannerManagement.DAL.Domain.dnc_AdvertiserRepositoryArtifacts
{
    /// <summary>
    /// Construct a dnc_Advertiser object from a datareader.
    /// </summary>
    internal class GetAllFromdnc_AdvertiserFactory : IDomainObjectFactory<dnc_Advertiser>
    {
        public dnc_Advertiser Construct(IDataReader reader)
        {
			dnc_Advertiser dnc_Advertiser = new dnc_Advertiser();
			
			int iDIndex = reader.GetOrdinal("ID"); 
            if(!reader.IsDBNull(iDIndex))
            {
				dnc_Advertiser.ID= reader.GetInt32(iDIndex);

			}

			int nameIndex = reader.GetOrdinal("Name"); 
            if(!reader.IsDBNull(nameIndex))
            {
				dnc_Advertiser.Name= reader.GetString(nameIndex);

			}

           
			return dnc_Advertiser; 
        }
    }
}

